<#include "../common/top.ftl"/>
<!DOCTYPE html>
<html>
    <head>
        <title>FreeMarker BootStrap demo</title>
    </head>
    <body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>demo<small>bootstrap，freemarker</small></h5>
                        <div class="ibox-tools">
                        </div>
                    </div>
                    <div class="ibox-content">

                        <table class="table table-hover table-bordered table-striped">
                            <thead>
                            <tr>
                                <th>ID</th>
                                <th>名称</th>
                                <th>年龄</th>
                                <th>创建时间date</th>
                                <th>创建时间datetime</th>
                                <th>创建时间</th>
                            </tr>
                            </thead>
                            <tbody>
                            <#if pageInfo.list?exists>
                                <#list pageInfo.list as demo>
                                <tr class="gradeX">
                                    <td>${demo.id?if_exists}</td>
                                    <td>${demo.name?if_exists}</td>
                                    <td>${demo.age?if_exists}</td>
                                    <td>${demo.createTime?date}</td>
                                    <td>${demo.createTime?datetime}</td>
                                    <td class="center">${demo.createTime?string("yyyy-MM-dd HH:mm:ss")}</td>
                                </tr>
                                </#list>
                            </#if>
                        </table>
                        <div class="row">
                            <div class="col-sm-6">
                                <#--<div id="" class="dataTables_info" role="alert" aria-live="polite" aria-relevant="all">-->
                                    共计${pageInfo.total}条
                                <#--</div>-->
                            </div>
                            <div class="col-sm-6">
                                <nav aria-label="Page navigation dataTables_paginate paging_simple_numbers">
                                    <ul class="pagination" >
                                        <li><a href="${base}/demo/queryDemoByPage?pageNum=1">首页</a></li>
                                        <!--上一页-->
                                        <li>
                                        <#if !pageInfo.isFirstPage>
                                            <a href="${base}/demo/queryDemoByPage?pageNum=${pageInfo.pageNum-1}" aria-label="Previous">
                                                <span aria-hidden="true">«</span>
                                            </a>
                                        </#if>
                                        </li>
                                        <!--循环遍历连续显示的页面，若是当前页就高亮显示，并且没有链接-->
                                        <#list pageInfo.navigatepageNums as page_num>
                                            <#if page_num == pageInfo.pageNum>
                                                <li class="active"><a href="javascript:void(0);">${page_num}</a></li>
                                            </#if>
                                            <#if page_num != pageInfo.pageNum>
                                                <li><a href="${base}/demo/queryDemoByPage?pageNum=${page_num}">${page_num}</a></li>
                                            </#if>
                                        </#list>

                                        <!--下一页-->
                                        <li>
                                        <#if !pageInfo.isLastPage>
                                            <a href="${base}/demo/queryDemoByPage?pageNum=${pageInfo.pageNum+1}" aria-label="Next">
                                                <span aria-hidden="true">»</span>
                                            </a>
                                        </#if>
                                        </li>

                                        <li><a href="${base}/demo/queryDemoByPage?pageNum=${pageInfo.pages}">尾页</a></li>
                                    </ul>
                                </nav>
                                <#--</div>-->
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    </body>
</html>